Optimal. Leaf size=215 \[ \frac {1}{8} \left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) x+\frac {\left (10 a b B+a^2 (4 A+5 C)+b^2 (4 A+5 C)\right ) \sin (c+d x)}{5 d}+\frac {\left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (2 A b+5 a B) \cos ^3(c+d x) \sin (c+d x)}{20 d}+\frac {A \cos ^4(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{5 d}-\frac {\left (2 A b^2+10 a b B+a^2 (4 A+5 C)\right ) \sin ^3(c+d x)}{15 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.36, antiderivative size = 215, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.171, Rules used = {4179, 4159,
4132, 2715, 8, 4129, 3092} \begin {gather*} -\frac {\sin ^3(c+d x) \left (a^2 (4 A+5 C)+10 a b B+2 A b^2\right )}{15 d}+\frac {\sin (c+d x) \left (a^2 (4 A+5 C)+10 a b B+b^2 (4 A+5 C)\right )}{5 d}+\frac {\sin (c+d x) \cos (c+d x) \left (3 a^2 B+6 a A b+8 a b C+4 b^2 B\right )}{8 d}+\frac {1}{8} x \left (3 a^2 B+6 a A b+8 a b C+4 b^2 B\right )+\frac {a (5 a B+2 A b) \sin (c+d x) \cos ^3(c+d x)}{20 d}+\frac {A \sin (c+d x) \cos ^4(c+d x) (a+b \sec (c+d x))^2}{5 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2715
Rule 3092
Rule 4129
Rule 4132
Rule 4159
Rule 4179
Rubi steps
\begin {align*} \int \cos ^5(c+d x) (a+b \sec (c+d x))^2 \left (A+B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\frac {A \cos ^4(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{5 d}+\frac {1}{5} \int \cos ^4(c+d x) (a+b \sec (c+d x)) \left (2 A b+5 a B+(4 a A+5 b B+5 a C) \sec (c+d x)+b (2 A+5 C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a (2 A b+5 a B) \cos ^3(c+d x) \sin (c+d x)}{20 d}+\frac {A \cos ^4(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{5 d}-\frac {1}{20} \int \cos ^3(c+d x) \left (-4 \left (2 A b^2+10 a b B+a^2 (4 A+5 C)\right )-5 \left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) \sec (c+d x)-4 b^2 (2 A+5 C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac {a (2 A b+5 a B) \cos ^3(c+d x) \sin (c+d x)}{20 d}+\frac {A \cos ^4(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{5 d}-\frac {1}{20} \int \cos ^3(c+d x) \left (-4 \left (2 A b^2+10 a b B+a^2 (4 A+5 C)\right )-4 b^2 (2 A+5 C) \sec ^2(c+d x)\right ) \, dx-\frac {1}{4} \left (-6 a A b-3 a^2 B-4 b^2 B-8 a b C\right ) \int \cos ^2(c+d x) \, dx\\ &=\frac {\left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (2 A b+5 a B) \cos ^3(c+d x) \sin (c+d x)}{20 d}+\frac {A \cos ^4(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{5 d}-\frac {1}{20} \int \cos (c+d x) \left (-4 b^2 (2 A+5 C)-4 \left (2 A b^2+10 a b B+a^2 (4 A+5 C)\right ) \cos ^2(c+d x)\right ) \, dx-\frac {1}{8} \left (-6 a A b-3 a^2 B-4 b^2 B-8 a b C\right ) \int 1 \, dx\\ &=\frac {1}{8} \left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) x+\frac {\left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (2 A b+5 a B) \cos ^3(c+d x) \sin (c+d x)}{20 d}+\frac {A \cos ^4(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{5 d}+\frac {\text {Subst}\left (\int \left (-4 b^2 (2 A+5 C)-4 \left (2 A b^2+10 a b B+a^2 (4 A+5 C)\right )+4 \left (2 A b^2+10 a b B+a^2 (4 A+5 C)\right ) x^2\right ) \, dx,x,-\sin (c+d x)\right )}{20 d}\\ &=\frac {1}{8} \left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) x+\frac {\left (10 a b B+a^2 (4 A+5 C)+b^2 (4 A+5 C)\right ) \sin (c+d x)}{5 d}+\frac {\left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) \cos (c+d x) \sin (c+d x)}{8 d}+\frac {a (2 A b+5 a B) \cos ^3(c+d x) \sin (c+d x)}{20 d}+\frac {A \cos ^4(c+d x) (a+b \sec (c+d x))^2 \sin (c+d x)}{5 d}-\frac {\left (2 A b^2+10 a b B+a^2 (4 A+5 C)\right ) \sin ^3(c+d x)}{15 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.81, size = 169, normalized size = 0.79 \begin {gather*} \frac {60 \left (6 a A b+3 a^2 B+4 b^2 B+8 a b C\right ) (c+d x)+60 \left (12 a b B+2 b^2 (3 A+4 C)+a^2 (5 A+6 C)\right ) \sin (c+d x)+120 \left (a^2 B+b^2 B+2 a b (A+C)\right ) \sin (2 (c+d x))+10 \left (4 A b^2+8 a b B+a^2 (5 A+4 C)\right ) \sin (3 (c+d x))+15 a (2 A b+a B) \sin (4 (c+d x))+6 a^2 A \sin (5 (c+d x))}{480 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.14, size = 244, normalized size = 1.13 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 233, normalized size = 1.08 \begin {gather*} \frac {32 \, {\left (3 \, \sin \left (d x + c\right )^{5} - 10 \, \sin \left (d x + c\right )^{3} + 15 \, \sin \left (d x + c\right )\right )} A a^{2} + 15 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} B a^{2} - 160 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} C a^{2} + 30 \, {\left (12 \, d x + 12 \, c + \sin \left (4 \, d x + 4 \, c\right ) + 8 \, \sin \left (2 \, d x + 2 \, c\right )\right )} A a b - 320 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} B a b + 240 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} C a b - 160 \, {\left (\sin \left (d x + c\right )^{3} - 3 \, \sin \left (d x + c\right )\right )} A b^{2} + 120 \, {\left (2 \, d x + 2 \, c + \sin \left (2 \, d x + 2 \, c\right )\right )} B b^{2} + 480 \, C b^{2} \sin \left (d x + c\right )}{480 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.84, size = 171, normalized size = 0.80 \begin {gather*} \frac {15 \, {\left (3 \, B a^{2} + 2 \, {\left (3 \, A + 4 \, C\right )} a b + 4 \, B b^{2}\right )} d x + {\left (24 \, A a^{2} \cos \left (d x + c\right )^{4} + 30 \, {\left (B a^{2} + 2 \, A a b\right )} \cos \left (d x + c\right )^{3} + 16 \, {\left (4 \, A + 5 \, C\right )} a^{2} + 160 \, B a b + 40 \, {\left (2 \, A + 3 \, C\right )} b^{2} + 8 \, {\left ({\left (4 \, A + 5 \, C\right )} a^{2} + 10 \, B a b + 5 \, A b^{2}\right )} \cos \left (d x + c\right )^{2} + 15 \, {\left (3 \, B a^{2} + 2 \, {\left (3 \, A + 4 \, C\right )} a b + 4 \, B b^{2}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: SystemError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 720 vs.
\(2 (203) = 406\).
time = 0.52, size = 720, normalized size = 3.35 \begin {gather*} \frac {15 \, {\left (3 \, B a^{2} + 6 \, A a b + 8 \, C a b + 4 \, B b^{2}\right )} {\left (d x + c\right )} + \frac {2 \, {\left (120 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 75 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 120 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 150 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 240 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 120 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 120 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} - 60 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 120 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{9} + 160 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 30 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 320 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 60 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 640 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 240 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 320 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 120 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 480 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 464 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 400 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 800 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 400 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 720 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 160 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 30 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 320 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 60 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 640 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 240 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 320 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 120 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 480 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 120 \, A a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 75 \, B a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 120 \, C a^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 150 \, A a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 240 \, B a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 120 \, C a b \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 120 \, A b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 60 \, B b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 120 \, C b^{2} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1\right )}^{5}}}{120 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 4.55, size = 256, normalized size = 1.19 \begin {gather*} \frac {\frac {25\,A\,a^2\,\sin \left (3\,c+3\,d\,x\right )}{2}+\frac {3\,A\,a^2\,\sin \left (5\,c+5\,d\,x\right )}{2}+30\,B\,a^2\,\sin \left (2\,c+2\,d\,x\right )+10\,A\,b^2\,\sin \left (3\,c+3\,d\,x\right )+\frac {15\,B\,a^2\,\sin \left (4\,c+4\,d\,x\right )}{4}+30\,B\,b^2\,\sin \left (2\,c+2\,d\,x\right )+10\,C\,a^2\,\sin \left (3\,c+3\,d\,x\right )+75\,A\,a^2\,\sin \left (c+d\,x\right )+90\,A\,b^2\,\sin \left (c+d\,x\right )+90\,C\,a^2\,\sin \left (c+d\,x\right )+120\,C\,b^2\,\sin \left (c+d\,x\right )+60\,A\,a\,b\,\sin \left (2\,c+2\,d\,x\right )+\frac {15\,A\,a\,b\,\sin \left (4\,c+4\,d\,x\right )}{2}+20\,B\,a\,b\,\sin \left (3\,c+3\,d\,x\right )+60\,C\,a\,b\,\sin \left (2\,c+2\,d\,x\right )+45\,B\,a^2\,d\,x+60\,B\,b^2\,d\,x+180\,B\,a\,b\,\sin \left (c+d\,x\right )+90\,A\,a\,b\,d\,x+120\,C\,a\,b\,d\,x}{120\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________